package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.BmsBatteryDao;
import com.tbit.uqbike.client.pojo.BmsBattery;
import com.tbit.uqbike.client.service.BmsBatteryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service("bmsBatteryService")
public class BmsBatteryServiceImpl implements BmsBatteryService {
    @Autowired
    private BmsBatteryDao bmsBatteryDao;

    @Override
    public BmsBattery getByBatteryModelId(Integer batteryModelId) {
        return bmsBatteryDao.getByBatteryModelId(batteryModelId);
    }

    @Override
    public BmsBattery getByMachineId(Integer machineId) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("machineId", machineId);

        return bmsBatteryDao.getByMachineId(params);
    }


}  